package com.cloud.yangfeiself.event;

import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.cloud.bus.event.RemoteApplicationEvent;

/**
 * 分布式应用事件（多应用中公用事件）
 *
 * @author Yang Fei
 * @date 2021/2/20
 */
@Data
@Builder
@NoArgsConstructor
public class DistributeEvent extends RemoteApplicationEvent {
    public Integer code;
    public String msg;

    public DistributeEvent(Object source, String originService, String destinationService, Integer code, String msg) {
        super(source, originService, destinationService);
        this.code = code;
        this.msg = msg;
    }

    public DistributeEvent(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
